<template>
  <div class="app-container flex-col minH">
    <div class="topline w100p bgwhite ptb20 radius10 pl10 pr20 justify-between">
      <div>
        <el-input v-model="input2" style="width: 280px" placeholder="搜尋陪玩ID..." :prefix-icon="Search" class="search" />
        <el-select v-model="value" placeholder="選擇項目類型" size="large" style="width: 240px">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
        </el-select>
        <el-time-picker v-model="value2" placeholder="開始時間" />
        <span class="plr10">-</span>
        <el-time-picker v-model="value2" placeholder="結束時間" />

      </div>
      <div class="noshrink">
        <el-button class="btn2">查詢</el-button>
        <el-button class="btn1">重置</el-button>
      </div>
    </div>
    <div class="bgblueg ptb30 radius10 w100p mt15 plr80 justify-between">
      <div class="align-center clr3c4 flex1">
        <div>
          <div class="ft46">88889</div>
          <div>新增用戶</div>
        </div>
        <div class="ml6p">
          <div class="ft46">88889</div>
          <div>新增陪玩</div>
        </div>
        <div class="ml6p">
          <div class="ft46">VIP紅利</div>
          <div>最多估比</div>
        </div>
      </div>
      <div>
        <el-button class="btn2" @click="dialogTableVisible = true">
          <el-icon class="mr5">
            <Histogram />
          </el-icon>

          充值金額排行榜</el-button>
        <el-button class="btn2" @click="dialogTableVisible = true">
          <el-icon class="mr5">
            <Histogram />
          </el-icon>

          消費金額排行榜</el-button>
      </div>

    </div>
    <div class="mt15 radius10 hidden pb15 flex1 bgwhite  flex-col w100p">
      <div class="flex1 w100p ">
        <el-table :data="tableData" style="width: 100%" cell-class-name="tbcell" header-cell-class-name="hdcell">

          <el-table-column prop="address" label="首次充值" sortable />
          <el-table-column prop="address" label="縂充值" sortable />
          <el-table-column prop="address" label="縂消費" sortable />
          <el-table-column prop="address" label="當日出款" sortable />
          <el-table-column prop="address" label="縂出款" sortable fixed="right" width="150">
            <template #default="scope">
              <el-icon @click="dialogTableVisible = true">
                <View />
              </el-icon>
              <span class="ml10">{{ scope.row.address }}</span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="plr20 mlauto">
        <div>小計(元): <span class="ft46 clr3c4 ml10">445587</span> </div>
      </div>
      <div class="plr20 mlauto mt20">
        <el-pagination v-model:current-page="currentPage3" prev-text="上一頁" next-text="下一頁" :default-page-size="15" :small="small" :disabled="disabled" :background="true" layout="prev, pager, next, jumper" :total="1000" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
      </div>

    </div>
    <el-dialog v-model="dialogTableVisible" title="本月紅利排行榜" width="900">
      <div class="plr20 justify-between ptb20">
        <div>
          <el-time-picker v-model="value2" placeholder="開始時間" />
          <span class="plr10">-</span>
          <el-time-picker v-model="value2" placeholder="結束時間" />
        </div>
        <div class="noshrink">
          <el-button class="btn2">查詢</el-button>
          <el-button class="btn1">重置</el-button>
        </div>

      </div>
      <el-table :data="tableData" cell-class-name="dialogtbcell" header-cell-class-name="dialoghdcell">
        <el-table-column property="name" label="用戶訊息" min-width="100" />
        <el-table-column property="name" label="用戶昵稱" min-width="100" />
        <el-table-column property="address" label="用戶頭像" width="100">
          <template #default>
            <el-avatar shape="square" :size="50" :fit="'cover'" :src="url" />
          </template>

        </el-table-column>
        <!-- <el-table-column property="address" label="充值金額" />
        <el-table-column property="address" label="創建時間" /> -->
        <el-table-column property="name" label="消費類型" width="100" />
        <el-table-column property="name" label="消費金額" width="100" />
        <el-table-column property="name" label="注冊時間" min-width="100" />

      </el-table>
      <div class="  plr20 justify-between mt20">
        <div style="flex:1;" class="clr3c4 bold">總共10條</div>
        <div>小計(元): <span class="ft46 clr3c4 ml10">445587</span> </div>
      </div>
      <div class="flex-col w100p">
        <div class="plr20 mt20 mlauto">
          <el-pagination v-model:current-page="currentPage3" prev-text="上一頁" next-text="下一頁" :default-page-size="15" :small="small" :disabled="disabled" :background="true" layout="prev, pager, next, jumper" :total="1000" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
        </div>
      </div>

    </el-dialog>
  </div>
</template>

<script setup>
import { Search } from '@element-plus/icons-vue'
import { ref } from 'vue'
import { useRouter } from 'vue-router';
const input2 = ref('')
const value = ref('')
const value1 = ref('')
const value2 = ref('')
const dialogTableVisible = ref(false)
const options = [
  {
    value: 'Option1',
    label: 'Option1',
  },
  {
    value: 'Option2',
    label: 'Option2',
  },
  {
    value: 'Option3',
    label: 'Option3',
  },
  {
    value: 'Option4',
    label: 'Option4',
  },
  {
    value: 'Option5',
    label: 'Option5',
  },
]
const tableData = [
  {
    id: 1,
    date: '2016-05-03',
    name: 'Tom',
    address: '123',
  },
  {
    id: 1,
    date: '2016-05-02',
    name: 'Tom',
    address: '123',
  },
  {
    id: 1,
    date: '2016-05-04',
    name: 'Tom',
    address: '123',
  },
  {
    id: 1,
    date: '2016-05-01',
    name: 'Tom',
    address: '123',
  },
]
const tableRowClassName = () => {
  return 'tbrow'
}
const currentPage3 = ref(5)
const handleSizeChange = (val) => {
  console.log(`${val} items per page`)
}
const handleCurrentChange = (val) => {
  console.log(`current page: ${val}`)
}
const router = useRouter()
const toAdd = () => {
  console.log(router)
  router.push({ path: 'addNotice' })
}
const edit = (type) => {
  router.push({ path: 'signEdit' })
}
</script>

<style lang="scss" scoped>
.search {
  overflow: hidden;
  border-radius: 10px !important;
  padding: 5px 0px;
}
</style>
<style></style>
 